In networks, it may be desirable to control or limit the amount of data which may flow through a particular switch. For example, a leaky bucket may impose a hard limit on the data transmission rate of a switch, whereas a token bucket may allow a certain amount of burstiness while imposing a limit on the average data transmission rate.